/**
 * @UiControl.hpp
 * Copyright 2013 (C) FatalEror / Dean Bahari
 * 
 * UiPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * See LICENSE file in main folder for more information.
 */

#ifndef _UI_CONTROL_HPP_
#define _UI_CONTROL_HPP_

class UiEvent;
class UiTooltip;

class UiControl : public UiBase {
	UiTooltip *mTooltip;
protected:
	int mState;
public:
	UiControl();
	~UiControl();

	enum State {
		UI_HOVERED  = 0x001,
		UI_DISABLED = 0x002,
		UI_ACTIVE   = 0x004,
		UI_IMAGE    = 0x008,
		UI_SELECTED = 0x010,
	};

	int  getState();
	void setState(int state);
	void showTooltip(const wchar_t *text);
protected:
	virtual void onCreate(UiEvent &ev);
	virtual void onPaint(UiEvent &ev);
	virtual void onResize(UiEvent &ev);
	virtual void onMove(UiEvent &ev);
	virtual void onClick(UiEvent &ev);
	virtual void onHover(UiEvent &ev);
	virtual void onEnter(UiEvent &ev);
	virtual void onLeave(UiEvent &ev);

	virtual LRESULT CALLBACK handleCustomProc(UINT msg, WPARAM wParam, LPARAM lParam);
};

#endif//_UI_CONTROL_HPP_